package com.sike.netty.im.client.handler;

import cn.hutool.core.date.DateUtil;
import com.sike.netty.im.client.event.GroupChatEvent;
import com.sike.netty.im.client.service.BeanFactory;
import com.sike.netty.im.client.service.ClientService;
import com.sike.netty.im.common.command.GroupChatResponseCommand;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.Scanner;

/**
 * 群聊响应 handler
 *
 * @author chenssy
 * @date 2023/09/23
 */
public class GroupChatResponseHandler extends SimpleChannelInboundHandler<GroupChatResponseCommand> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, GroupChatResponseCommand msg) throws Exception {
        System.out.println("[" + DateUtil.now() + "]:["  + msg.getGroupName() + "]-" + msg.getFromUser() + " >>> " + msg.getMessage());
    }
}
